const mongoose = require('mongoose')
/**
 * 维护用户id自增表
 */
const leaveSchema = new mongoose.Schema({
  orderNo:String,
  applyType:Number, //
  startTime:String,
  endTime:String,
  DateProcess:String,
  auditUsers:String,
  applyUser:{
    userId:String,
    userName:String,
    userEmail:String
  },
  leaveTime:String,
  reasons:String,
  curAuditUserName:String,
  auditFluws:[
    {
    userId:String,
    userName:String,
    userEmail:String  
    }
  ],
  auditLogs:[
    {
        userId:String,
        userName:String,
        userEmail:String,
        remak:String,
        action:String  
    }
  ],
  applyState:{type:Number,default:1},
  createTime:{type:Date,default:Date.now}
})

const leave = mongoose.model('leave',leaveSchema,'leave')

module.exports={
    leave
}